<script>
    $(function(){
        wx.config({
            debug: false,
            appId: '{$wechat.appId}',
            timestamp: '{$wechat.timestamp}',
            nonceStr: '{$wechat.nonceStr}',
            signature: '{$wechat.signature}',
            jsApiList: ['updateAppMessageShareData','updateTimelineShareData']
        });
        wx.ready(function () {
            //分享给朋友
            wx.updateAppMessageShareData({
                title: '{$web_title}',
                desc: '{$desc}',
                link: '{$link}',
                imgUrl: '{$imgUrl}',
                success: function (res) {}
            });
            //分享到朋友圈
            wx.updateTimelineShareData({
                title: '{$web_title}',
                link: '{$link}',
                imgUrl: '{$imgUrl}',
                success: function (res) {}
            });
        });
        wx.error(function (res) {});
    });
</script>